import { reactive, computed, toRefs } from 'vue'
import { defineStore } from 'pinia'

export const useMainStore = defineStore('main', () => {

  const state = reactive({
    isCollapse: false
  })

  const getter = {

  }

  const action = {
    changeFoldMenuState(value) {
      if(state.isCollapse === value) return 
      state.isCollapse = value === undefined ? !state.isCollapse : value
    }
  }

  return {
    ...toRefs(state),
    ...getter,
    ...action
  }
})
